<%@ page pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html>
<html>
<head>
<jsp:include page="/pages/head.jsp">
	<jsp:param value="修改书本信息" name="title" />
</jsp:include>
</head>
<body>
	<jsp:include page="/pages/admin/admin_nav.jsp">
		<jsp:param value="food_m" name="fun" />
	</jsp:include>
	<div class="container-fluid">
		<div class="row">
			<div class="col-md-2 col-0"></div>
			<div class="col-md-8 col-12">
				<div class="card border-warning">
					<div class="card-header border-warning bg-warning">
						<h5 class="text-center">修 改 书 本</h5>
					</div>
					<form role="form" method="post" action="admin_edit_food_do.action"
						enctype="multipart/form-data">
						<input type="hidden" name="id" value="${food.id }">
						<div class="card-body">
							<div class="form-group">
								<label for="foodname">书本名称</label> <input type="text"
									class="form-control" name="fn" id="foodname"
									required="required" value="${food.foodname }" />
							</div>
							<div class="form-group">
								<label for="feature">书本作者</label>
								<textarea class="form-control" rows="3" name="fea" id="feature"
									required="required">${food.feature }</textarea>
							</div>
							<div class="form-group">
								<label for="material">书本简介</label>
								<textarea class="form-control" rows="3" name="mat" id="material"
									required="required">${food.material }</textarea>
							</div>
							<div class="form-group">
								<label for="type">所属分类</label> <select class="form-control"
									name="type" id="type">
									<c:forEach items="${types }" var="type">
										<option value="${type.id }"
											${type.id == food.typeid?'selected':'' }>
											${type.typename }</option>
									</c:forEach>
								</select>
							</div>
							<div class="form-group">
								<label for="price">书本价格</label> <input type="number"
									class="form-control" name="price" id="price"
									required="required" value="${food.price }" />
								<p class="text-info">单位：元</p>
							</div>
							<div class="form-group">
								<label for="img">书本图片</label>
								<input type="file" id="img" name="img" />
								<p class="text-info">请选择上传的稿件图片，大小应小于5M，扩展名为jpg,png或gif。</p>
								<img src="${pageContext.request.contextPath }/${food.picture }">
							</div>
							<div class="form-group">
								<label for="comment">书本备注</label> <input type="text"
									class="form-control" name="com" id="comment"
									value="${food.comment }" required="required" />
								<p class="text-info">-1代表正常书本，0代表商家推荐，正整数代表特价书本价格。</p>
							</div>
						</div>
						<div class="card-footer border-warning text-center">
							<button type="submit" class="btn btn-warning">确认修改</button>
							&nbsp;&nbsp; <a role="button" class="btn btn-default"
								href="javascript:history.back();">放弃返回</a>
						</div>
					</form>
				</div>
			</div>
			<div class="col-md-2 col-0"></div>
		</div>
		<!--ending 2th row-->
	</div>
</body>
</html>